package javase2.day06.demo01;

public class ThreadZi extends Thread{
    @Override
    public void run() {
        //获取线程名称的第一种方式：getName
        String n = getName();
        System.out.println(n);
        /*
Thread-0
Thread-2
Thread-3
Thread-1
         */
        //获取线程名称的第二种方式：currentThread
//        Thread n = currentThread();
//        System.out.println(n);
        /*
Thread[Thread-1,5,main]
Thread[Thread-0,5,main]
Thread[Thread-3,5,main]
Thread[Thread-2,5,main]
         */
    }
}
